<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Test training params on subsets of the training data</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="svm.construct.html">« SVM::__construct</a></li>
      <li style="float: right;"><a href="svm.getoptions.html">SVM::getOptions »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.svm.html">SVM</a></li>
    <li>Test training params on subsets of the training data</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="svm.crossvalidate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SVM::crossvalidate</h1>
  <p class="verinfo">(PECL svm &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">SVM::crossvalidate</span> &mdash; <span class="dc-title">Test training params on subsets of the training data</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-svm.crossvalidate-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>svm::crossvalidate</strong></span>(<span class="methodparam"><span class="type">array</span> <code class="parameter">$problem</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$number_of_folds</code></span>): <span class="type">float</span></div>

  <p class="para rdfs-comment">
   Crossvalidate can be used to test the effectiveness of the current 
   parameter set on a subset of the training data. Given a problem set 
   and a n &quot;folds&quot;, it separates the problem set into n subsets, and the 
   repeatedly trains on one subset and tests on another. While the accuracy 
   will generally be lower than a SVM trained on the enter data set, the 
   accuracy score returned should be relatively useful, so it can be used to 
   test different training parameters. 
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-svm.crossvalidate-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">problem</code></dt>

     <dd>

      <p class="para">
      The problem data. This can either be in the form of an array, the URL 
      of an SVMLight formatted file, or a stream to an opened SVMLight 
      formatted datasource. 
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">number_of_folds</code></dt>

     <dd>

      <p class="para">
       The number of sets the data should be divided into and cross tested. 
       A higher number means smaller training sets and less reliability. 5 is 
       a good number to start with. 
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-svm.crossvalidate-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The correct percentage, expressed as a floating point number from 0-1. 
   In the case of NU_SVC or EPSILON_SVR kernels the mean squared error will 
   returned instead. 
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-svm.crossvalidate-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="svm.train.html" class="methodname" rel="rdfs-seeAlso">SVM::train()</a> - Create a SVMModel based on training data</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>